<%--
  Created by IntelliJ IDEA.
  User: Galle
  Date: 2022/4/14
  Time: 22:36
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
    <%
        String username = request.getParameter("username");
        String password = request.getParameter("password");

        if (username.equals("admin") && password.equals("1234")){
            session.setAttribute("username", username);
            response.sendRedirect("success.jsp");
        }
        else {
            request.setAttribute("loginMsg", "用户名或密码不正确");
            request.getRequestDispatcher("index.jsp").forward(request,response);
        }
    %>
</body>
</html>
